// <copyright file="TagCountExtensions.cs" company="Clever Software">
// Copyright (c) 2013, 2014 All Right Reserved, http://www.cleversoftware.by
//
// This source is subject to the Microsoft Permissive License.
// Please see the License.txt file for more information.
// All other rights reserved.
//
// THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY 
// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// </copyright>
// <author>Clever Software</author>
// <email>info@cleversoftware.by</email>
// <date>2014-02-04</date> 
// <summary>CleverCMS source code</summary>

//TODO: Is it needed here ?
namespace CleverCMS.Cms.Services.ViewModels
{
    public static class TagCountExtensions
    {
        public static string GetTagClass(this TagCountModel tc, int total)
        {
            if (total == 0)
            {
                total = 1;
            }

            int result = (tc.Count*100)/total;

            if (result <= 3)
                return "tag1";
            if (result <= 8)
                return "tag2";
            if (result <= 15)
                return "tag3";
            if (result <= 20)
                return "tag4";
            if (result <= 30)
                return "tag5";
            if (result <= 45)
                return "tag6";
            return "tag7";
        }
    }
}